package top.wettis.chat.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.wettis.chat.pojo.DO.AskExpert;
import top.wettis.chat.pojo.VO.Result;
import top.wettis.chat.service.impl.AskExpertServiceImpl;

/**
 * <p>
 * 专家问答 前端控制器
 * </p>
 *
 * @author wettis
 * @since 2023-04-15
 */
@RestController
@CrossOrigin(origins = "*")
@RequestMapping("/chat/askExpert")
public class AskExpertController {
    @Autowired
    private AskExpertServiceImpl askExpertService;
    @PostMapping("/add")
    private Result<Object> save(@RequestBody AskExpert askExpert){
        return askExpertService.add(askExpert);
    }
    @GetMapping("/list")
    private Result<Object> getAll(){
        return askExpertService.getAll();
    }
}
